﻿using System.Collections.Generic;
using BusinessLogicLibrary.CustomerModule;
using entities;

namespace ServiceLibrary
{
    public class ExternalService : IExternalService
    {
        private readonly CustomerManament _customerManagement = new CustomerManament();

        #region "CUSTOMER Management"

        public string CusAdd(string pIdentityNumber, string pCustomerName, string pCustomerPhone, string pCustomerEmail, bool pCustomerSex)
        {
            return _customerManagement.CreateCustomer(pIdentityNumber, pCustomerName, pCustomerPhone, pCustomerEmail, pCustomerSex);
        }

        public string CusModify(string pIdentityNumber, string pCustomerName, string pCustomerPhone, string pCustomerEmail, bool pCustomerSex)
        {
            return _customerManagement.EditCustomer(pIdentityNumber, pCustomerName, pCustomerPhone, pCustomerEmail, pCustomerSex);
        }

        public string UpdateUserPW(string pUN, string pPW)
        {
            return _customerManagement.UpdateUserPW(pUN, pPW);
        }

        public List<Customer> FindCustomerByName(string pCustomerName)
        {
            return _customerManagement.FindCustomerByName(pCustomerName);
        }

        public Customer FindCustomerByAccount(string pCustomerAccount)
        {
            return _customerManagement.FindCustomerByAccount(pCustomerAccount);
        }

        public Customer FindCustomerByIdentityNumber(string pIdentityNumber)
        {
            return _customerManagement.FindCustomerByID(pIdentityNumber);
        }

        public bool CusEmailCheck(string email)
        {
            return _customerManagement.CustomerEmailCheck(email);
        }

        public bool CusIdCheck(string id)
        {
            return _customerManagement.CustomerIdCheck(id);
        }

        #endregion        
    }
}